/*
 * @Author: your name
 * @Date: 2020-10-21 10:33:01
 * @LastEditTime: 2020-11-10 14:23:04
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /crowd-funding/src/components/pages/App.jsx
 */
import React from 'react'
import { useSelector } from 'react-redux'
import ErrorPage from './ErrorPage/index'
import BottomBtn from '../animate/BottomBtn'
import HomePage from './HomePage'
import Toast from '../common/Toast'

export default () => {
	const errorData = useSelector((state) => state.errorData)
	const { code } = errorData
	// const { isLoading } = this.props.mainData
	// if (code !== 0) return <ErrorPage {...{ code, message, img, reloadAction }} />
	if (code !== 0) return <ErrorPage {...errorData} />
	// if (isLoading) return <LoadingPage isLoading={isLoading} />
	return (
		<div
			style={{
				width: '100%',
				height: '100vh',
				position: 'relative',
			}}>
			<HomePage />
			{/* <ErrorPage /> */}
			<Toast />
			<BottomBtn />
			{/* <HeaderOpen /> */}
			{/* <GoSettleAccounts /> */}
		</div>
	)
}
